import com.heima.model.schedule.dto.Task;
import com.heima.schedule.ScheduleApplication;
import com.heima.schedule.service.TaskService;
import org.checkerframework.checker.units.qual.A;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

@SpringBootTest(classes = ScheduleApplication.class)
@RunWith(SpringRunner.class)
public class test {
@Autowired
private TaskService service;
@Autowired
private  StringRedisTemplate stringRedisTemplate;

    @Test
    public  void test(){
        Task task=new Task();
        task.setExecuteTime(new Date().getTime());
        task.setTaskType(101);
        task.setParameters("task test".getBytes());
        task.setPriority(51);
        service.addTask(task);
        //        service.poll(100,50);
//         service.cancelTask(1791016713121296385L);

    }
    @Test
    public  void test0a()
    {
        stringRedisTemplate.opsForList().remove("topic_100_50",0,null);
    }

}
